package common

import (
	"net/http"

	"github.com/kataras/iris/v12"
)

// 设置全局Cookie
func SetGlobalCookie(ctx iris.Context, name string, value string) {
	ctx.SetCookie(&http.Cookie{
		Name:name,
		Value:value,
		Path:"/",
	})
	
}

// type Cookie struct {
//     Name  string
//     Value string

//     Path       string    // optional
//     Domain     string    // optional
//     Expires    time.Time // optional
//     RawExpires string    // for reading cookies only

//     // MaxAge=0 means no 'Max-Age' attribute specified.
//     // MaxAge<0 means delete cookie now, equivalently 'Max-Age: 0'
//     // MaxAge>0 means Max-Age attribute present and given in seconds
//     MaxAge   int
//     Secure   bool
//     HttpOnly bool
//     SameSite SameSite
//     Raw      string
//     Unparsed []string // Raw text of unparsed attribute-value pairs
// }